﻿using AutoMapper;
using Volo.Abp.AuditLogging;
using Volo.Abp.Identity;
using WeChat.CMS.Attachments;
using WeChat.CMS.AuditLogging;
using WeChat.CMS.Foods;
using WeChat.CMS.OrganizationUnits;
using WeChat.CMS.SecurityLogs;

namespace WeChat.CMS;

public class CMSApplicationAutoMapperProfile : Profile
{
    public CMSApplicationAutoMapperProfile()
    {
        /* You can configure your AutoMapper mapping configuration here.
         * Alternatively, you can split your mapping configurations
         * into multiple profile classes for a better organization. */

        CreateMap<OrganizationUnit, OrganizationUnitTreeDto>();

        CreateMap<OrganizationUnit, OrganizationUnitEto>();

        CreateMap<IdentityUser, OrganizationUnBindUseResponseDto>();

        #region AuditLog
        //AuditLog
        CreateMap<AuditLog, AuditLogDto>()
            .MapExtraProperties();

        CreateMap<EntityChange, EntityChangeDto>()
            .MapExtraProperties();

        CreateMap<EntityPropertyChange, EntityPropertyChangeDto>();

        CreateMap<AuditLogAction, AuditLogActionDto>();
        #endregion


        CreateMap<IdentitySecurityLog, SecurityLogDto>();
        CreateMap<Attachment, AttachmentDTO>();

        CreateMap<Food, FoodDto>();
    }
}
